package com.winenine999.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CPurchaseordersubMapper;
import com.winenine999.jdbc.dao.PurchaseordersubDao;
import com.winenine999.model.Page;
import com.winenine999.model.Purchaseordersub;
import com.winenine999.service.IPurchaseordersubService;

@Service
public class PurchaseordersubService implements IPurchaseordersubService{
	@Autowired
	private IPurchaseordersubService purchaseordersubService;
	@Autowired
	private PurchaseordersubDao purchaseordersubDao;
	@Autowired
	private CPurchaseordersubMapper cPurchaseordersubMapper;
	@Override
	public List<Purchaseordersub> findPurchaseordersub() {
		
		return purchaseordersubService.findPurchaseordersub();
	}
	@Override
	public Page findPurchaseordersub(Page page) {
		
		return purchaseordersubDao.findPurchaseordersub(page);
	}
	/**
	 * 分页
	 */
	@Override
	public Page findPageOrderinfos(Page page) {

		return purchaseordersubDao.findPageOrderinfos(page);
	}

	@Override
	public Integer updateWineNum(Map map) {
		return cPurchaseordersubMapper.updateWineNum(map);
	}

	@Override
	public boolean wineOrderIsExistOrNot(Map map) {
		System.out.println(map.get("phid"));
		System.out.println(map.get("uid"));
		System.out.println(map.get("wid"));
		List<Map<String, Object>> list = cPurchaseordersubMapper.wineOrderIsExistOrNot(map);
		System.out.println("==========查出来的结果====="+list);
		boolean b = true;
		if (list.isEmpty() || list == null) {
			b = false;
			System.out.println("order不存在！");
		}
		System.out.println("order存在！");
		return b;
	}

	@Override
	public Integer insertWineOrder(Map map) {
		return cPurchaseordersubMapper.insertWineOrder(map);
	}

	@Override
	public Integer deletewineOrder(Map map) {
		return cPurchaseordersubMapper.deletewineOrder(map);
	}
}
